<template>
  <el-dialog :visible.sync="value" :before-close="() => $emit('input', false)">
    <template slot="title">
      查看成员
    </template>
    <el-form label-width="80px" style="height: 60vh;overflow: auto;">
      <el-form-item label="岗位" v-for="(memberInfo, index) in memberList" :key="index">
        <div>{{memberInfo}}</div>
        <el-row>
          <el-col :span="6" :key="childInfo.id" v-for="childInfo in memberInfo.children">{{childInfo.name}}</el-col>
        </el-row>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="$emit('input', false)">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
  import {authDepartmentMemberListApi} from '@/services/api/permission';

  import getCommand from '@/mixins/getCommand';

  export default {

    name: 'display-member-dialog',

    props: ['value','departmentId'],

    mixins: [getCommand],

    data() {
      return {
        memberList: []
      }
    },
    methods: {
    },
    mounted() {
      this.bindGet(authDepartmentMemberListApi, 'memberList', {
        sendingData: {departmentId: this.departmentId}
      });
      this.getAll();
    },
  }
</script>

<style scoped>
</style>
